<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $this->systemName;?></title>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/css/main.css" />
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/jquery.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/load.js"></script>

<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/jquery.colorbox.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/jQselect.js"></script>
<link href="<?php echo $this->baseUrl;?>/files/admin/js/colorbox.jquery/colorbox2.css" rel="stylesheet" type="text/css"/>
</head>

<body>
	<div id="main">
		<div id="topMenu">
			<div id="navigation">当前位置：软件包申请列表</div>
	    <div id="topOtherMenu">
			  <div align="right"></div>
		  </div>
		</div>
		<div id="body">
			<div id="search">
				<form id="searchForm" name="searchForm" method="post" action="<?php echo $this->projectUrl();?>">
					<table width="100%" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td>
								渠道编号：
								  <input type="text" id="memberCode" name="memberCode" value="<?php echo $this->memberCode;?>" class="input">
								  &nbsp;产品
								  ：
								   <select name="productCode" id="productCode" style="width:100px">
                                  <option value="">选择</option>
                                  
						           <?php foreach($this->products as $product):?>
                                <option value="<?php echo $product['code'];?>"
                                <?php if($product['code']==$this->productCode):?>
                                 selected="selected"
                                <?php endif;?>
                                ><?php echo $product['name'];?></option>
                              <?php endforeach;?>
                              </select>
								  &nbsp;操作系统：
								  <select name="osName" id="osName" style="width:100px">
                                  <option value="">选择</option>
                                                                    </select>
								  <input type="hidden" name="default_osName" id="default_osName" 
                                  value="<?php echo $this->osName;?>" /> 
								  &nbsp;状态：
								  <select name="status" id="select4">
                                    <option value=""></option>
								    <option value="1" 
                                    <?php if($this->status=="1"):?>
                                     selected="selected"
                                    <?php endif;?>
                                    
                                    >未处理</option>
								    <option value="2"      
                                     <?php if($this->status=="2"):?>
                                     selected="selected"
                                    <?php endif;?>
                                    >已审核未通过</option>
								    <option value="3"
                                     <?php if($this->status=="3"):?>
                                     selected="selected"
                                    <?php endif;?>
                                    
                                    >审核通过待打包</option>
								    <option value="4"
                                     <?php if($this->status=="4"):?>
                                     selected="selected"
                                    <?php endif;?>>已打包待测试</option>
								    <option value="5"
                                      <?php if($this->status=="5"):?>
                                     selected="selected"
                                    <?php endif;?>
                                    >测试通过</option>
								    <option value="6"                                      
									<?php if($this->status=="6"):?>
                                     selected="selected"
                                    <?php endif;?>>审核发布</option>
                                                                                                      </select>
				              <input type="submit" name="button" id="button" value="查找" class="button" />
							</td>
						</tr>
					</table>
				</form>
			</div>
			<div id="content">
				<form id="listForm" name="listForm" method="post" action="">
					<table class="table">
						<tr class="subject">
                          <td>产品</td>
						  <td>产品编号</td>
						  <td>操作系统</td>
						  <td>申请数量</td>
						  <td>申请渠道</td>
						  <td>申请渠道经理</td>
						  <td>申请日期</td>
						  <td>申请备注</td>
						  <td>状态</td>
						  <td>审核时间</td>
						  <td>详细</td>
						  <td class="checkBoxTd">操作</td>
					  </tr>
                        <?php foreach($this->rows as $row):?>
						<tr class="dataLine">
                         
							<td><?php echo $row['productName'];?></td>
							<td><?php echo $row['productCode'];?></td>
							<td><?php echo $row['osName'];?></td>
							<td><?php echo $row['applyNum'];?></td>
							<td><?php echo $row['memberCode'];?></td>
							<td><?php echo $row['applyUserName'];?></td>
							<td><?php echo $row['applyTime'];?></td>
							<td><?php echo $row['applyNotes'];?></td>
							<td>
                            <?php 
							switch ($row['status']) {
								case 1: 
								echo "未处理";
								break;
								case 2: 
								echo "已审核未通过";
								break;
								case 3: 
								echo "审核通过<BR />待打包";
								break;
								case 4:
								echo "已打包待测试";
								break;
								case 5:
								echo "测试通过";
								break;
								case 6:
								echo "普通审核通过，等待特级审核";
								break;
								}
							?>
                            </td>
							<td><?php echo $row['checkTime'];?></td>
							<td><a href="<?php echo $this->projectUrl(array('action'=>'detail-'.$this->suffix,'id'=>$row['id']));?>">详细</a></td>
							<td class="checkBoxTd">
                            
                            <?php if($row['status']!="1" && $row['status']!="2"):?>
                            <a href="<?php echo $this->projectUrl(array('controller'=>'source-app','action'=>'index-upload','memberSourceApplyId'=>$row['id']));?>">查看软件包</a>
                            
                            <?php else:?>
                            等待通过审核
                            <?php endif;?>                 </td>
					  </tr>
                        <?php endforeach;?>
					</table>
<table class="controlTable">
						<tr>
							<td align="left">&nbsp;</td>
						  <td colspan="6" class="paginator"><div align="right"><?php echo $this->pageString;?></div></td>
						</tr>
					</table>
			  </form>
			</div>
		</div>
</div>
<script language="javascript">
function del()
{
	if (confirm('确定删除吗？')) {
		$("#listForm").attr('action', '<?php echo $this->projectUrl(array('action'=>'delete'));?>');
		$("#listForm").submit();
		return true;
	} else {
		return false;
	}
}
</script>

<script>

<!-- 更新productCode时，更新Osname-->
$(function(){
	$("#productCode").change(function(){
	var self=$("#osName")[0];
		 $.ajax({ url: "<?php echo $this->projectUrl(array('controller'=>'source','action'=>'osnames'));?>",
              type:"post",           
             dataType:"json",
             data: "productCode="+$("#productCode option:selected").val(),
             success:function(data){ 
			 			
			 						self.options.length=0;
									self.options[0] = new Option('选择', '');
									var default_osName=$("#default_osName").val();
                                   $.each(data,function(i){
								   	self.options[i+1] = new Option(data[i], data[i]);
								   		 if(default_osName==data[i]) {										 
										 	self.options[i+1].selected=true;																					
										 } 
											  }); 
								   
                              } 
         });
	
	
	
	})
	
	$("#productCode").change();
	
})

<!-- 更新productCode时，更新Osname-->
</script>
</body>
</html>